<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>{$title}</title>
    <link type="text/css" rel="stylesheet" href="{$url_front}/statics/css/monkey.css"/>
    <link type="text/css" rel="stylesheet" href="{$url_front}/statics/css/frame.css"/>
    <script type="text/javascript" src="{$url_front}/statics/js/jquery.min.js"></script>
    <!--editor-->
    <script type="text/javascript" src="{$url_front}/statics/js/editor/kindeditor.min.js"></script>
    <script type="text/javascript" src="{$url_front}/statics/js/editor/lang/zh_CN.js"></script>
    <link type="text/css" rel="stylesheet" href="{$url_front}/statics/js/editor/themes/default/default.css"/>
    <!--validator-->
    <script type="text/javascript" src="{$url_front}/statics/js/koo.min.js"></script>
    <!--uploader-->
    <link href="{$url_front}/statics/uploader/client/fileuploader.css" rel="stylesheet" type="text/css">
    <script src="{$url_front}/statics/uploader/client/fileuploader.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(function () {
            //validator
            $('.u_form').Koo();
            //editor
            KindEditor.ready(function (K) {
                K.create('#content', {
                    themeType: 'default',
                    height: 300
                });
            });

            createUploader();
        });

        function createUploader() {
            var uploader = new qq.FileUploader({
                element: document.getElementById('file-uploader'),
                multiple: false,
                action: '{$url_upload}',
                onSubmit: function (id, fileName) {
                    setImage('');
                },
                onComplete: function (id, fileName, responseJSON) {
                    setImage(responseJSON.filename);
                },
                onDeleteUploaded: function (id, fileName) {
                    setImage('');
                }
            });
        }

        function setImage(filename) {
            $('#goods_image').attr('src', filename + '?');
            $('#input_goods_image').attr('value', filename);
        }
    </script>

    <script type="text/javascript" src="{$url_front}/statics/js/monkey.js"></script>
</head>

<body>
<!--page_header-->
<div class="page_header">
    <h3><span class="iconfont">&#xf044;</span>{$title}</h3>

</div>
<!--/page_header-->

<!--page_main-->
<div class="page_main">

    <div style="display: block;">
        <!--form-->
        <form class="u_form" name="" method="post" action="{$url_save}">
            <table class="u_table u_table_inbox">
                <tbody>
                <!--//'g_id','gc_id','g_name','captain','detail','image','price','keywords','description','add_time','top_sort','click'-->
                <tr>
                    <td align="right"><span class="u_fom_required">*</span>商品名称：</td>
                    <td><input class="u_input" type="text" name="captain" value="{$goods.captain}" check="need"/>
                        <input style="display: none;" class="u_input u_input_disable" type="text" name="g_id"
                               value="{$goods.g_id}" readonly="readonly">
                        <input style="display: none;" class="u_input u_input_disable" type="text" name="add_time"
                               value="{$goods.add_time}" readonly="readonly">
                        <input style="display: none;" class="u_input u_input_disable" type="text" name="click"
                               value="{$goods.click}" readonly="readonly">
                    </td>
                </tr>
                <tr>
                    <td align="right">品种：</td>
                    <td>
                        <select id="category_list" class="u_select" name="gc_id">
                            {$category_list}
                        </select>
                    </td>
                </tr>
                <tr>
                    <td align="right">唯一标识：</td>
                    <td><input class="u_input" type="text" name="g_name" value="{$goods.g_name}"/></td>
                </tr>
                <tr>
                    <td align="right">价格：</td>
                    <td><input class="u_input" type="text" name="price" value="{$goods.price}"/></td>
                </tr>
                <tr>
                    <td align="right">图片：</td>
                    <td>
                        <img id="goods_image" src="{$goods.image}"
                             style="max-width: 400px;width: 400px;height: 300px;"/>

                        <div id="file-uploader">
                            <noscript>
                                <p>Please enable JavaScript to use file uploader.</p>
                                <!-- or put a simple form for upload here -->
                            </noscript>
                        </div>
                        <input id="input_goods_image" style="display: none;" class="u_input" type="text" name="image"
                               value="{$goods.image}"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">是否顶置：</td>
                    <td><label><input type="checkbox" name="is_top" <!--if/$is_top--> checked <!--/-->/>顶置</label></td>
                </tr>
                <tr>
                    <td width="140" align="right">详细介绍：</td>
                    <td>
                        <textarea id="content" name="detail" style="width:100%;height:450px;visibility:hidden;">
                            {$goods.detail}
                        </textarea>
                    </td>
                </tr>
                <tr>
                    <td align="right"><span class="u_fom_required">*</span>关键词：</td>
                    <td><input class="u_input" style="width: 300px;" size="200" type="text" name="keywords"
                               value="{$goods.keywords}" check="need"/></td>
                </tr>
                <tr>
                    <td align="right"><span class="u_fom_required">*</span>简单描述：</td>
                    <td><input class="u_input" style="width: 300px;" size="200" type="text" name="description"
                               value="{$goods.description}" check="need"/></td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <input type="submit" class="u_button u_button_blue" style="margin-left: 100px;" value="保存">
                    </td>
                </tr>
                </tbody>
            </table>
        </form>
        <!--/form-->
    </div>

</div>
<!--/page_main-->
<br/><br/>
</body>
</html>